import { Comment } from '@/constants/comment'

export const getGravatar = (emailhash: string) => {
  // https://en.gravatar.com/site/implement/images/
  return `https://www.gravatar.com/avatar/${emailhash}`
}

export const autoCommentAvatar = (comment: Comment) => {
  if (comment.author.email_hash) {
    return getGravatar(comment.author.email_hash)
  }

  return ''
}
